﻿using System;
using System.Collections.Generic;
using Validate.Net;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            UserModel user = new UserModel()
            {
                Account = "1000",
                Password = "",
                Email = "77111.cn",
                ZipCode = "6572151",
                Chinese = "wjl",
                NegtiveInt = 1,
                PositiveInt= -2,
                Ip = "192.0.0.256",
                url = "https://www.baidu.com",
                CustomStr = "657215@",
                MaxLength = null,
                Age = 100,
                Letter = "www",
                MinLong = 0,
                AgeRange = 0,
                MinLength = "123456",
                QQ = "13155654521",
                IDCard = "2102111972110408721",
                SocialCreditCode = "91350500611880326T",
                Pwd = "wjl1345",
                NonpositiveInt = -66.1,
                NonnegativeInt = 66.1,
            };

            if (!user.Validate<UserModel>(out List<string> errorList))
            {
                foreach (string error in errorList)
                {
                    Console.WriteLine($"{error}\r\n");
                }
                
            }
            Console.ReadLine();
        }
    }
}
